///////////////////////////////////////////////////////////
//  CurrentCommand.cpp
//  Implementation of the Class CurrentCommand
//  Created on:      21-Sep-2013 12:06:39 PM
//  Original author: Jakkaphan Aiemcharoenjit
///////////////////////////////////////////////////////////

#include "CurrentCommand.h"


using namespace UI;
using namespace UI::CMD;

CurrentCommand* UI::CMD::CurrentCommand::g_currentCmdInstance = NULL;



CurrentCommand::CurrentCommand()
{
  this->m_currentCommand = ICommand::UNKNOWN_CMD;
  this->m_newOrEditCommand = ICommand::UNKNOWN_CMD;
}


CurrentCommand::~CurrentCommand()
{

}


CurrentCommand* CurrentCommand::GetInstance()
{
  if(!g_currentCmdInstance)
    g_currentCmdInstance = new CurrentCommand();
	return g_currentCmdInstance;
}


void CurrentCommand::Release()
{
  if(g_currentCmdInstance)
    delete g_currentCmdInstance;

  g_currentCmdInstance = NULL;
}


ICommand::CommandType CurrentCommand::GetCurrentCommand()
{
	return  this->m_currentCommand;
}


void CurrentCommand::SetCurrentCommand(ICommand::CommandType _type)
{
  this->m_currentCommand = _type;
}

ICommand::CommandType CurrentCommand::GetNewOrEditCommand()
{
  return this->m_newOrEditCommand;
}

void CurrentCommand::SetNewOrEditCommand( ICommand::CommandType _type )
{
  this->m_newOrEditCommand = _type;
}

